_package("sample");

_import("caf.core.AppBase");
_import("caf.ui.Button");
_import("caf.ui.ToolBar");
_import("caf.ui.TabBar");
_import("caf.ui.TabPanel");
_import("caf.ui.form.Checkbox");
_import("caf.ui.form.InputArea");
_import("caf.ui.Map");

/**
 * 搜索应用
 */
_class("AppSample", AppBase, function(){
	this.__conf__({
		"tags": [
			{"tag": "a:button"   , "clazz": "Button"   },
			{"tag": "a:toolsbar" , "clazz": "ToolBar"  },
			{"tag": "a:tabbar"   , "clazz": "TabBar"   },
			{"tag": "a:tabpanel" , "clazz": "TabPanel" },
			{"tag": "a:checkbox" , "clazz": "Checkbox" },
			{"tag": "a:inputarea", "clazz": "InputArea"},
			{"tag": "a:map"      , "clazz": "Map"      }
		],
		//"model": [],
		"page": [
			//键(pageid)     模板文件名         类名                 简要说明
			{"pid": "home", "tpl": "home.xml", "clazz": "HomePage"}
		]
	});
	this._init = function(){
		_super._init.call(this);
	};
	this.init = function(){
		_super.init.apply(this, arguments);
		//window.alert("应用程序入口");
		//注册组件的自定义标签
		this._taglib.regTags(this.findConf("tags"));
		//注册模板库
		this._template.reg(runtime.getTplData("sample.tpl"));
		this._deckPage.create(runtime.getWorkspace(), this, this._history);
		//this._deckPage._self.innerHTML = this.getTpl("device.xml");
		this.reset();
	};
	this.reset = function(){
		_super.reset.apply(this, arguments);
		this._deckPage.reset();
		this.navPage("home");
	};
	this.dispose = function(){
		_super.dispose.apply(this);
	};
});